class Student():
    def __init__(self,name,age):
        self.name = name
        self.age = age
    # __str__魔术方法
    def __str__(self):
        return f"Student类对象，name：{self.name}，age：{self.age}"
    # __lt__魔术方法：比大小
    # def __lt__(self, other):
    #     return self.age < other.age
    # __le__魔术方法：比大于等于和小于等于
    def __le__(self, other):
        return self.age <= other.age
    # __eq__魔术方法：比是否相等
    def __eq__(self, other):
        return self.age == other.age

stu1 = Student("李健奇",22)
stu2 = Student("小李",26)
stu3 = Student("小万",26)
print(stu1 <= stu2)
print(stu1 >= stu2)
print(stu2 == stu3)
